<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>sc3doc</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

<style type="text/css">
/* Overrides of notebook CSS for static HTML export */
body {
  overflow: visible;
  padding: 8px;
}
div#notebook {
  overflow: visible;
  border-top: none;
}@media print {
  div.cell {
    display: block;
    page-break-inside: avoid;
  } 
  div.output_wrapper { 
    display: block;
    page-break-inside: avoid; 
  }
  div.output { 
    display: block;
    page-break-inside: avoid; 
  }
}
</style>

<!-- Custom stylesheet, it must be in the parent directory as the html file -->
<link rel="stylesheet" type="text/css" media="all" href="../doc.css" />
<link rel="stylesheet" type="text/css" media="all" href="doc.css" />

<!-- Loading mathjax macro -->
<!-- Load mathjax -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
    <!-- MathJax configuration -->
    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [ ['$','$'], ["\\(","\\)"] ],
            displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
            processEscapes: true,
            processEnvironments: true
        },
        // Center justify equations in code and markdown cells. Elsewhere
        // we use CSS to left justify single line equations in code cells.
        displayAlign: 'center',
        "HTML-CSS": {
            styles: {'.MathJax_Display': {"margin": 0}},
            linebreaks: { automatic: true }
        }
    });
    </script>
    <!-- End of mathjax configuration --></head>
<body>
  <div tabindex="-1" id="notebook" class="border-box-sizing">
    <div class="container" id="notebook-container">

<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="Simplicial-Complex-in-Three-Dimensions">Simplicial Complex in Three Dimensions<a class="anchor-link" href="#Simplicial-Complex-in-Three-Dimensions">&#182;</a></h1>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>We dsecribe the data structure of the simplicial complex associated to a three dimensional trianglulation give by <code>node,elem</code> . The <code>node</code> records
the coordinates of vertices and <code>elem</code> is the pointer from local to
global incices of vertices. See <a href="meshbasicdoc.html">Basic mesh data structure</a>.</p>
<p>A brief summary.</p>
<ul>
<li><p><code>edge</code>: asecond ordering, i.e. <code>edge(:,1)&lt;edge(:,2)</code></p>
</li>
<li><p><code>face</code>: asecond ordering, i.e. <code>face(:,1)&lt;face(:,2)&lt;face(:,3)</code></p>
</li>
<li><p><code>elem</code>: either the positive ordering or the ascend ordering. The default one is the positive ordering and the asecond ordering is mainly used for edge and face elements.</p>
</li>
<li><p>Use <code>[elem,bdFlag] = sortelem3(elem,bdFlag)</code> to change the ordering to the ascend ordering. Note that <code>bdFlag</code> should be switched together.</p>
</li>
</ul>
<blockquote><p>The multigrid solvers use the original ordering of <code>elem</code> obtained from either uniform refinement or bisection methods. So let <code>elemold=elem</code> before sort.</p>
</blockquote>
<ul>
<li>Examples on the usage: <code>Poisson3RT0; Maxwell; Maxwell2;</code></li>
</ul>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Outline">Outline<a class="anchor-link" href="#Outline">&#182;</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>The basic data structure of a mesh consists of <code>node</code> and <code>elem</code>. The corresponding simplicial complex consists of vertices, edges, faces, and tetrahedron. We shall discuss three issues</p>
<ul>
<li><em>Indexing</em> of simplexes</li>
<li><em>Ordering</em> of vertices</li>
<li><em>Orientation</em> of simplexes</li>
</ul>
<p>The indexing and ordering are related and the ordering and orientation
are mixed together. However the indexing has nothing to do with the
orientation. The indexing and ordering are the combinarotry structure,
i.e. only <code>elem</code> is needed, while the orientation also depends on <code>node</code>,
the geometry emembdding of vertices.</p>
<p>For indexing, ordering and orientation, there are always local and global versions. The relation between the local and global version is the most complicated issue.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Indexing-of-Simplexes">Indexing of Simplexes<a class="anchor-link" href="#Indexing-of-Simplexes">&#182;</a></h2><p>The indexing refers to the numbering of simplexes, e.g., which face is
numbered as the first one. There are two types of the indexing: local and
global. Each simplex in the simplicial complex has a unique index which
is called the global index. In one tetrahedra, the four vertices and four
faces have their local index from 1:4.</p>
<p>In the assembling procedure of finite element methods, an element-wise
matrix using the local indexing is first computed and then assembled to get a
big matrix using the global indexing. Thus the pointer from the local
indexing to the global indexing is indispensible. For bases independent of
the ordering and orientation, e.g., <code>P1</code> and <code>P2</code> elements, this pointer
is sufficient, otherwise, the inconsistency of the local ordering/orientation
and the global ordering/orientation should be taken into account.</p>
<h3 id="Local-indexing">Local indexing<a class="anchor-link" href="#Local-indexing">&#182;</a></h3><p>The tetrahedron consists of four vertices indexed as [1 2 3 4]. Each
tetrahedron contains four faces and six edges. They can be indexed as</p>

<pre><code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3];
locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];

</code></pre>
<p>In <code>locFace</code>, the i-th face is opposite to the i-th vertices and thus
this is called <em>opposite indexing</em>. In <code>locEdge</code>, it is the
<em>lexicographic indexing</em> which is induced from the lexicographic ordering
of the six edges. The ordering of vertices of each face or edge will not
change the indexing. For example, the following <code>locFacec</code> and <code>locEdged</code>
has the same indexing as <code>locFace</code> and <code>locEdge</code> but a different ordering
of vertices.</p>

<pre><code>locFacec = [2 3 4; 1 4 3; 1 2 4; 1 3 2];
locEdge = [2 1; 3 1; 4 1; 3 2; 4 2; 4 3];

</code></pre>
<p>Indeed any permuation of each simplex will represent the same simplex and
will not change the indexing. The ordering of vertices will affect the
orientation and will be discussed later.</p>
<p>For a face consists of three vertices [1 2 3], there are two indexing
schemes of its three edges.</p>
<ul>
<li>Oppoiste indexing:        <code>[2 3; 3 1; 1 2]</code></li>
<li>Lexicographic indexing:   <code>[1 2; 1 3; 2 3]</code></li>
</ul>
<p>Each indexing scheme has its advantange and disadavantange and which one
to chose depends on the consideration of ordering and orientation.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Global-indexing-and-vertex-pointers">Global indexing and vertex pointers<a class="anchor-link" href="#Global-indexing-and-vertex-pointers">&#182;</a></h3><p>Each simplex in the simplicial complex has a unqiue index. It is
represented by vertices pointer from the local index to the globa index
of vertices.</p>
<p>The matrix <code>elem</code> is the pointer from local to global indices of vertices
of tetrahedron, e.g. <code>elem(t,1)=25</code> means the first vertex of the
tetrahedron t is the 25-th vertex.</p>
<p>Similarly the <code>NE x 2</code> matrix <code>edge</code> records all edges and the <code>NF x 3</code> by 3
matrix <code>face</code> records all faces of the triangulation. These are vertices
pointers. We shall discuss the elementwise pointer from the local indices to
the global indices for edges and faces.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[16]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="p">[</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">]</span> <span class="p">=</span> <span class="n">cubemesh</span><span class="p">([</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span><span class="mi">2</span><span class="p">);</span>
<span class="n">showmesh3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">,[],</span><span class="s">&#39;FaceAlpha&#39;</span><span class="p">,</span><span class="mf">0.25</span><span class="p">);</span>
<span class="n">findelem3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">);</span>
<span class="n">findnode3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">(:));</span>
<span class="n">display</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem =

     1     2     3     7
     1     4     3     7
     1     5     6     7
     1     5     8     7
     1     2     6     7
     1     4     8     7

</pre>
</div>
</div>

<div class="output_area">

<div class="prompt"></div>




<div class="output_png output_subarea ">
<img src="
B3RJTUUH4wEFCgMgS27s0wAAACR0RVh0U29mdHdhcmUATUFUTEFCLCBUaGUgTWF0aFdvcmtzLCBJ
bmMuPFjdGAAAACJ0RVh0Q3JlYXRpb24gVGltZQAwNS1KYW4tMjAxOSAwMjowMzozMvhyhy0AACAA
SURBVHic7d1rdFXVvffxf0IMBrlqDCo3RW5HpfIobby0KFocFssotYoNlpa0HGqPbT0YfMLQ51iw
Dg+xRbyUdhSlqVIfKtojFo3VoHirFgWfKGpNBCwiYIIa5E7I5XmxwmKz987ea629LnPO9f0MXyR7
b3YmDpJffnPOtWZeR0eHAAAQtfyoBwAAgAiBBABQBIEEAFACgQQAUAKBBABQAoEEAFACgQQAUAKB
BABQAoEEAFACgQQAUAKBBABQAoEEAFACgQQAUAKBBABQAoEEAFACgQQAUAKBBABQAoEEqK6lpWX7
9u1RjwIIXEHUAwCQxapVq8rLyy+55JIePXoUFRUlPnXjjTcOHTo0qoEB/iKQANV99tlnTU1Nf/7z
n5MeHz169N133x3JkIAgEEiA6tasWfOnP/1p4MCB+flH5thnz569dOnSggK+hWEO/jUDqtu/f/+1
116b+Mi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4W/qlQ1rSq4r8VuBcQEgQRjeahKTlaS0i4gubrdg3NUIsQKgQSThXNjVt8n68ghxBOBBPO5
qkpur0nyN43YrYA4I5AQC4qfYUElAoRAQqw4rEoZSlLSAlKO9YgcAhIRSIgXH6tSLmnE1ByQikBC
HGWtSqklyboq9skHn8zl61KJgAwIJMSU2zMskq6KdVuPqERAVgQSYi3DJbSpJcleQHKeRlQiwDkC
CfD/FFpyCPCAQAJEuqhKabfbZa5HTM0BnhFIwBFpq1LF6Arrg7IZZVYatTW2/Xr2ryf/bPLIr4y0
nqISAbkjkICjJG52SFI1rUpE7v3Rvbt279pYt7HtJ21CJQL8k8c3EpBWUiaVjCmx7qBa3VD96opX
7//f91uP8x0E+IVAAtJI25CS1NbWfv3rXw9hMEBM5Ec9AEA/Dz30UNRDAAxEIAEAlEAgAQCUQCAB
aWRYW2XZFQgIgQQAUALXIQHppV6QRDcCAkUgAZkQQkBomLIDACiBQAJc2717t4i0trZGPRDAKNyp
AXBh8uTJH3/8cV1dXVtb2zHHHHPhhRcOHTp0yZIlUY8LMAGBBABQAlN2AAAlEEgAACUQSAAAJRBI
AAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAA
JRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQ
SAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJRBIAAAlEEgAACUQSAAAJfx/kKTm5gy8
bJcAAAAASUVORK5CYII=
"
>
</div>

</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Generate-index-pointers-for-edges-and-faces">Generate index pointers for edges and faces<a class="anchor-link" href="#Generate-index-pointers-for-edges-and-faces">&#182;</a></h3><p>One can easily collect edges and faces elementwise. The issue is the
duplication. For example, each interior face will be counted twice. The
<code>unique</code> function is applied such that each edge or face has a unique
global index.</p>
<p><strong>Edge and Face</strong></p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[17]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">totalEdge</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">([</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span><span class="p">]);</span> <span class="c">...</span>
                    <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">3</span> <span class="mi">4</span><span class="p">])]);</span>
<span class="n">sortedTotalEdge</span> <span class="p">=</span> <span class="n">sort</span><span class="p">(</span><span class="n">totalEdge</span><span class="p">,</span><span class="mi">2</span><span class="p">);</span>
<span class="p">[</span><span class="n">edge</span><span class="p">,</span> <span class="o">~</span><span class="p">,</span> <span class="n">je</span><span class="p">]</span> <span class="p">=</span> <span class="n">unique</span><span class="p">(</span><span class="n">sortedTotalEdge</span><span class="p">,</span><span class="s">&#39;rows&#39;</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">edge</span><span class="p">);</span>

<span class="n">totalFace</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">([</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span> <span class="mi">3</span><span class="p">]);</span> <span class="c">...</span>
                    <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span> <span class="mi">2</span><span class="p">])]);</span>
<span class="n">sortedTotalFace</span> <span class="p">=</span> <span class="n">sort</span><span class="p">(</span><span class="n">totalFace</span><span class="p">,</span><span class="mi">2</span><span class="p">);</span>                
<span class="p">[</span><span class="n">face</span><span class="p">,</span> <span class="n">i2</span><span class="p">,</span> <span class="n">jf</span><span class="p">]</span> <span class="p">=</span> <span class="n">unique</span><span class="p">(</span><span class="n">sortedTotalFace</span><span class="p">,</span><span class="s">&#39;rows&#39;</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">face</span><span class="p">);</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
edge =

  19�2 uint32 matrix

   1   2
   1   3
   1   4
   1   5
   1   6
   1   7
   1   8
   2   3
   2   6
   2   7
   3   4
   3   7
   4   7
   4   8
   5   6
   5   7
   5   8
   6   7
   7   8


face =

  18�3 uint32 matrix

   1   2   3
   1   2   6
   1   2   7
   1   3   4
   1   3   7
   1   4   7
   1   4   8
   1   5   6
   1   5   7
   1   5   8
   1   6   7
   1   7   8
   2   3   7
   2   6   7
   3   4   7
   4   7   8
   5   6   7
   5   7   8

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>In iFEM, <code>N,NE,NF,NT</code> represents the number of vertices, edges, faces and tetrahedrons, resprectively.</p>

<pre><code>N = size(node,1); NT = size(elem,1); NF = size(face,1); NE = size(edge,1);

</code></pre>
<p>In the assembling procedure, the matrix is always computed elementwise and then assemble to a big one. A pointer from the local index of a simplex to its global index is thus indispensible.</p>
<p><strong>Elementwise pointers</strong></p>
<ul>
<li><code>elem2node = elem</code></li>
<li><code>elem2face(1:NT, 1:4)</code></li>
<li><code>elem2edge(1:NT, 1:6)</code></li>
</ul>
<p>Such information is exactly stored in the output of <code>unique</code> function. For example, <code>elem2face(t,1) = 17</code> means the first face of t (spanned by <code>[2 3 4]</code>) is the 17-th element in the <code>face</code> matrix.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[18]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">N</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span> <span class="n">NT</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">elem</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span> <span class="n">NF</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">face</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span> <span class="n">NE</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">edge</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
<span class="n">elem2edge</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">(</span><span class="nb">reshape</span><span class="p">(</span><span class="n">je</span><span class="p">,</span><span class="n">NT</span><span class="p">,</span><span class="mi">6</span><span class="p">));</span>
<span class="n">elem2face</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">(</span><span class="nb">reshape</span><span class="p">(</span><span class="n">jf</span><span class="p">,</span><span class="n">NT</span><span class="p">,</span><span class="mi">4</span><span class="p">));</span>
<span class="n">display</span><span class="p">(</span><span class="n">elem2edge</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">elem2face</span><span class="p">);</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem2edge =

  6�6 uint32 matrix

    1    2    6    8   10   12
    3    2    6   11   13   12
    4    5    6   15   16   18
    4    7    6   17   16   19
    1    5    6    9   10   18
    3    7    6   14   13   19


elem2face =

  6�4 uint32 matrix

   13    5    3    1
   15    5    6    4
   17   11    9    8
   18   12    9   10
   14   11    3    2
   16   12    6    7

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><strong>Face to edge Pointer</strong></p>
<p><code>face2edge(1:NF,1:3)</code> records the global indices of three edges of a
face. This pointer depends on the ordering of vertices of faces and the
indexing of local edges in a face. We list the following two important
cases. Other combinations is possible but not attractive.</p>
<ul>
<li>Ascend ordering.</li>
</ul>
<p>All local faces and local edges are ascend ordered.</p>

<pre><code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3];
locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];
edgeOfFace = [1 2; 1 3; 2 3];
locFace2edge = [4 5 6; 2 3 6; 1 3 5; 1 2 4];

</code></pre>
<ul>
<li>Consistent ordering</li>
</ul>
<p>The local face is ordered such that the corresponding orientation is
consistent with the induced orientation.</p>

<pre><code>locFace = [2 3 4; 1 4 3; 1 2 4; 1 3 2];
locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];
edgeOfFace = [2 3; 3 1; 1 2];   
locFace2edge = [6 5 4; 6 2 3; 5 3 1; 4 1 2];

</code></pre>
<p>The global one can be obtained from the composition of <code>elem2face</code> and
<code>locFace2edge</code>. For example, for the asecnd ordering scheme,</p>

<pre><code>face2edge(elem2face(:,1),:) = elem2edge(:,[4 5 6]);
face2edge(elem2face(:,2),:) = elem2edge(:,[2 3 6]);
face2edge(elem2face(:,3),:) = elem2edge(:,[1 3 5]);
face2edge(elem2face(:,4),:) = elem2edge(:,[1 2 4]);</code></pre>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Ordering-of-Vertices">Ordering of Vertices<a class="anchor-link" href="#Ordering-of-Vertices">&#182;</a></h2><p>We discuss the ordering of vertices of simplexes. Again there are local
ordering and global ordering. They may not be consistent and a sign array
is used to record the inconsistency if any.</p>
<p>The local ordering refers to the ordering of vertices in <code>locFace</code> or
<code>locEdge</code>, i.e. the ordering of the local index of vertices. For elements
associated to faces or edges, the local ordering could be used in the
formulation of the local basis and thus the ordering does matter.</p>
<p>The global ordering refers to the ordering of vertices in <code>face</code> or
<code>edge</code>, i.e., the ordering of the global index of vertices. Note that
that in either local or global ordering, permutation of vertices will
represent the same simplex. To fix an ordering we need extra information.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="elem">elem<a class="anchor-link" href="#elem">&#182;</a></h3><p>The local ordering is always [1 2 3 4]. Any permutation of four vertices of a tetrahedon still represents the same tetrahedron. Such freedom provide a room to record more information like:</p>
<ul>
<li>global ordering of vertices</li>
<li>an orientation of element</li>
<li>refinement rules (uniform refinement or bisection)</li>
</ul>
<p>For 2-D triangulations, three vertices of a triangle in 2-D is sorted counter-cloclwise and the first vertex is chosen as the newest vertex. Such ordering enables the efficient implementation of local refinement
and coarsening in 2-D; see <a href="../afem/bisectdoc.html">Bisection in Two Dimensions</a>
and <a href="../afem/coarsendoc.html">Coarsening in Two Dimensions</a>.</p>
<p>In 3-D, for the longest edge bisection, the newest vertex (with the highest generation) is stored as the last (4-th) vertex of a tetrahedron. For <a href="uniformrefine3doc.html">3-D Red Refinement</a>, the ordering determines the shape regularity of refined triangulation. Permuation of vertices in <code>elem</code> could deterioriate the angle condition after the refinement.</p>
<p>We shall reserve the ordering of <code>elem</code> from the mesh refinement and
coarsening since they are more subtle. We switch the ordering when
generating data structure for finite element basis and assemble the
matrix equation. Such sorting is hidden in the subroutines when a finite
element basis requiring ordering is generated.</p>
<p>Two types of ordering of <code>elem</code> is of particular importantance</p>
<ul>
<li>Ascend ordering</li>
<li>Positive ordering</li>
</ul>
<p>In the ascend ordering, the vertices of <code>elem</code> is sorted such that</p>

<pre><code>elem(t,1) &lt; elem(t,2) &lt; elem(t,3) &lt; elem(t,4). 

</code></pre>
<p>Such ordering will benefit the construction of local bases for high order basis or basis with orientation. This can be easily achieved by <code>elem = sort(elem,2)</code>. One has to rotate the boundary flag accordingly.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[22]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">bdFlag</span> <span class="p">=</span> <span class="n">setboundary3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">,</span><span class="s">&#39;Dirichlet&#39;</span><span class="p">);</span>
<span class="p">[</span><span class="n">elem</span><span class="p">,</span><span class="n">bdFlag</span><span class="p">]</span> <span class="p">=</span> <span class="n">sortelem3</span><span class="p">(</span><span class="n">elem</span><span class="p">,</span><span class="n">bdFlag</span><span class="p">);</span>    
<span class="n">display</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem =

     1     2     3     7
     1     3     4     7
     1     5     6     7
     1     5     7     8
     1     2     6     7
     1     4     7     8

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>In the positive ordering, the four vertices are ordered such that the
signed volume, the mix product of vectors (v12,v13,v14), is positive.
This is the default ordering used so far. <code>fixorder3</code> will switch the
vertices for elements with negative volume.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[25]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">elem</span> <span class="p">=</span> <span class="n">fixorder3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">)</span>   <span class="c">% switchs the vertices for elements with negative volume.</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem =

     1     2     3     7
     1     3     4     7
     1     5     6     7
     1     5     7     8
     1     6     2     7
     1     7     4     8

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="edge">edge<a class="anchor-link" href="#edge">&#182;</a></h3><p>For 3-D triangulations, we chose the ascend ordering both locally and globally. Namely</p>

<pre><code>locEdge(:,1) &lt; locEdge(:,2); 
   edge(:,1) &lt; edge(:,2);

</code></pre>
<p>Recall that for <code>locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4]</code>, it is ascend
ordered. The <code>edge</code> produced by <code>unique</code> function is also ascend
ordered.</p>
<p>There might be inconsistency between the local and global ordering.
That is <code>edge(elem2edge(t,1),1)</code> may not be smaller than <code>edge(elem2edge(t,1),2)</code>. It will be more clear from the discussion of the corresponding orientation.</p>
<p>For 2-D triangulations, the global ordering is still ascend ordered. But locally it may not. For example, for the consisitent ordering <code>locEdge = [2 3; 3 1; 1 2]</code>, then <code>locEdge(2,1) &gt; locEdge(2,2)</code>.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="face">face<a class="anchor-link" href="#face">&#182;</a></h3><p>For 3-D triangulations, the <code>face</code> produced by <code>unique</code> function is already sorted in the second dimension such that the global ordering is ascended i.e. <code>face(:,1) &lt; face(:,2) &lt; face(:,3)</code>. The local ordering in <code>locFace</code>, however, is not always ascend ordered.</p>

<pre><code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3]; % Ascend ordering
locFace = [2 3 4; 1 4 3; 1 2 4; 1 3 2]; % Consistent ordering

</code></pre>
<p>Again the local and the global ordering maynot be consisitent. That is</p>

<pre><code>face(elem2face(t,:),1) &lt; face(elem2face(t,:),2) &lt; face(elem2face(t,:),3)

</code></pre>
<p>maynot be always true unless we use the ascend ordering in both <code>face</code> and <code>locFace</code>.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Orientation">Orientation<a class="anchor-link" href="#Orientation">&#182;</a></h2><p>The orientation of a tetrahedron is either positive or negative. The
orientation of a face is given by a normal vector and the orientation of
an edge is determined by a tangential vector.</p>
<p>The orientation of a d-simplex will induce an orientation of its d-1 boundary
subcomplex and is called the <em>induced orientation</em>. For example, a positive
orientated tetrahedron will induce the outwards normal orientation of its
four faces and a positive orientated triangle will induce the counter
clockwise orientation of its three edges.</p>
<p>The ordering of vertices of a simplex will naturally introduce an
orientation and will be called the <em>ordering orientation</em>. More specifically</p>
<ul>
<li>the vector from <code>edge(:,1)</code> to <code>edge(:,2)</code> defines an orientation of edges.</li>
<li>the <code>cross(v12,v13)</code> defines an orientation of a face, where <code>vij</code> is
the vector from vertex <code>face(:,i)</code> to <code>face(:,j)</code>.</li>
<li>the sign of the mix product <code>sign(v12, v13, v14)</code> defines an orientation for tetrahedrons.</li>
</ul>
<p>The orientation of a simplex in the simplicial complex should be uniquely
determined which will be called the <em>global orientation</em>. It can be chosen as
the global ordering orientation but not always.</p>
<p>Inside one tetrahedron, the local ordering of local edges and local faces
will introduce a corresponding orientation. The orientation of the
tetrahedron will also induce an orientation for its four faces. These are
called the <em>local orientation</em> which may not be consisitent with the global
orientation. The local ordering orientation is used in the local basis and the induced orientation is used when computing the differential operator locally.</p>
<p>In general, there will be an inconsistency of different types of orientation and apporipate data structure should be constructured to record such inconsistency.</p>
<ul>
<li>a global orientation</li>
<li>the global ordering orientation</li>
<li>the local ordering orientation inside a tetrahedron</li>
<li>the local induced orientation inside a tetrahedron</li>
</ul>
<p>We now discuss the orientation of elem, face, and edge separately.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="elem">elem<a class="anchor-link" href="#elem">&#182;</a></h3><p>The orientation of a tetraheron is either positive or negative.
We chose the global ordering orientation, i.e., the sign of the signed
volume computed from <code>elem</code>.</p>

<pre><code>[Dlambda,volume,elemSign] = gradbasis3(node,elem);

</code></pre>
<p>In the output of <code>gradbasis3</code>, <code>volume</code> is always positive and an
additional array <code>elemSign</code> is used to record the sign of the signed
volume.</p>
<p><code>Dlambda(t,:,k)</code> is the gradient of $\lambda_k$ associated to vertex $k$. Therefore the outward normal direction of the kth face is <code>-Dlambda(t,:,k)</code> which is independent of the ordering and orientation of the element.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="face">face<a class="anchor-link" href="#face">&#182;</a></h3><p>Again we use the global ordering orientation determined by <code>face</code>. The normal vector is given by <code>cross(v12,v13)</code>.</p>
<p>The local ordering orientation is implicitly used when computing finite element basis in each element. For example, the RT0 basis on face <code>[i j k]</code> in <code>locFace</code> is defined as</p>
$$\phi_{i,j,k} = 2(\lambda_i \nabla \lambda_j \times \nabla \lambda_k+ \lambda_j \nabla \lambda_k \times \nabla \lambda_i+\lambda_k \nabla \lambda_i \times \nabla \lambda_j).$$<p></p>
<p>Odd permutation of <code>[i j k]</code> will change the sign of the basis. The direction of $\phi_{i,j,k}$ is the normal vector determined by <code>[i,j,k]</code> ordering. Note that this is defined locally, i.e., element by element.</p>
<p>The global basis associated to a face, however, depends only on the global orientation of this face. We introduce <code>elem2faceSign(1:NT, 1:4)</code> to record the inconsistency of a local ordering orientation and a global orientation.</p>
<p>For <code>locFace = [2 3 4; 1 4 3; 1 2 4; 1 3 2]</code>, i.e. the induced orientation, the <code>elem2faceSign</code> can be obtained from subroutine <code>dof3face</code> follows</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[27]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">totalFace</span> <span class="p">=</span> <span class="p">[</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span> <span class="mi">2</span><span class="p">])];</span>
<span class="n">elem2faceSign</span> <span class="p">=</span> <span class="nb">reshape</span><span class="p">(</span><span class="n">sum</span><span class="p">(</span><span class="nb">sign</span><span class="p">(</span><span class="n">diff</span><span class="p">(</span><span class="n">totalFace</span><span class="p">(:,[</span><span class="mi">1</span><span class="p">:</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">]),</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">)),</span><span class="mi">2</span><span class="p">),</span><span class="n">NT</span><span class="p">,</span><span class="mi">4</span><span class="p">)</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem2faceSign =

     1    -1     1    -1
     1    -1     1    -1
     1    -1     1    -1
     1    -1     1    -1
    -1    -1     1     1
    -1    -1     1     1

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>When both <code>elem</code> and <code>locFace</code> are ascend ordered, the orientation of the
global ordering is consistent with that of the local ordering. Thus
<code>elem2faceSign</code> is not needed for the ascending ordering in assembling the mass matrix.</p>
<p>But for the asecond ordering system, an <code>elem2faceSign</code> will be used when assembling differential operators because the orientation for Stokes theorem is induced orientation. For example, when computing <code>div</code> operators on a positive orientated tetrahedron, the faces should be orientated by the outwards normal direction but the global faces may not be.</p>
<p>If <code>elem</code> is positive ordered and <code>locFace</code> is consistently ordered, then this inconsistency is already recorded in <code>elem2faceSign</code>.</p>
<p>For the ascend ordering of <code>elem</code> and <code>locFace</code>, we use $+1$ if the
orientation of a face is the same with the induced outwords normal direction in a certain elem, and $-1$ otherwise. Then the inconsistency is given by <code>elem2faceSign = [1 -1 1 -1]</code> by comparing</p>
<ul>
<li>The induced orientation: <code>locFace = [2 3 4; 1 4 3; 1 2 4; 1 3 2]</code>;</li>
<li>The ascend orientation:    <code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3]</code>.</li>
</ul>
<p>Here we use the <em>ascend orientation</em> to refer to the orientation given by the ascend ordering.</p>
<p>In summary,</p>
<ul>
<li>the induced orientation is favorable for computing $d\phi$;</li>
<li>the asecond orientation is favorable for computing $(f, \phi)$ or $(\phi_i, \phi_j)$.</li>
</ul>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="edge">edge<a class="anchor-link" href="#edge">&#182;</a></h3><p>The orientation of edges is simpler than faces. Globally we always chose the global ascend ordering orientation. Namely the orientation of an edge is from the vertex with the smaller index to the larger one.</p>
<p>Locally the local ascend ordering may not be consistent with the global one. See Lowest Order Edge Element. For the ascend ordering of <code>elem</code> and <code>locEdge</code>, the local and the global
orientation will be consistent and no <code>elem2edgeSign</code> is needed!</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[28]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">totalEdge</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">([</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span><span class="p">]);</span> <span class="c">...</span>
                    <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">3</span> <span class="mi">4</span><span class="p">])]);</span>
<span class="n">direction</span> <span class="p">=</span> <span class="nb">ones</span><span class="p">(</span><span class="mi">6</span><span class="o">*</span><span class="n">NT</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39;int8&#39;</span><span class="p">);</span>
<span class="n">idx</span> <span class="p">=</span> <span class="p">(</span><span class="n">totalEdge</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)</span><span class="o">&gt;</span><span class="n">totalEdge</span><span class="p">(:,</span><span class="mi">2</span><span class="p">));</span>
<span class="n">direction</span><span class="p">(</span><span class="n">idx</span><span class="p">)</span> <span class="p">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
<span class="n">elem2edgeSign</span> <span class="p">=</span> <span class="nb">reshape</span><span class="p">(</span><span class="n">direction</span><span class="p">,</span><span class="n">NT</span><span class="p">,</span><span class="mi">6</span><span class="p">)</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem2edgeSign =

  6�6 int8 matrix

    1    1    1    1    1    1
    1    1    1    1    1    1
    1    1    1    1    1    1
    1    1    1    1    1    1
    1    1    1   -1    1    1
    1    1    1   -1    1    1

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="face-to-edge">face to edge<a class="anchor-link" href="#face-to-edge">&#182;</a></h3><p>For the ascend ordering <code>edgeofFace = [1 2; 1 3; 2 3]</code>, the local and the global ordering is consistent and so is the ordering orientation.</p>
<p>Then it is not consisitent with the induced positive (counter clockwise) orientation of edges. When the edge direction is the same with the induced direction, we use sign $+1$, otherwise $-1$. Then <code>face2edgeSign = [+1 -1 +1]</code> records the inconsistency of the ascend orientation of the induced orientation.</p>
<p>For the consistent ordering, <code>edgeofFace = [2 3; 3 1; 1 2]</code> which is consisent with the induced positive orientation but then may not be consistent with the global orientation of edges. We construct <code>face2edgeSign</code> to record such inconsistency</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[30]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">totalEdge</span> <span class="p">=</span> <span class="p">[</span><span class="n">face</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">face</span><span class="p">(:,[</span><span class="mi">3</span> <span class="mi">1</span><span class="p">]);</span> <span class="n">face</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span><span class="p">])];</span>
<span class="n">direction</span> <span class="p">=</span> <span class="nb">ones</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">NF</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
<span class="n">idx</span> <span class="p">=</span> <span class="p">(</span><span class="n">totalEdge</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)</span><span class="o">&gt;</span><span class="n">totalEdge</span><span class="p">(:,</span><span class="mi">2</span><span class="p">));</span>
<span class="n">direction</span><span class="p">(</span><span class="n">idx</span><span class="p">)</span> <span class="p">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
<span class="n">face2edgeSignp</span> <span class="p">=</span> <span class="nb">reshape</span><span class="p">(</span><span class="n">direction</span><span class="p">,</span><span class="n">NF</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
face2edgeSignp =

     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1
     1    -1     1

</pre>
</div>
</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Summary">Summary<a class="anchor-link" href="#Summary">&#182;</a></h2><p>We summarize the two popular ordering and orientation schemes below.</p>
<h3 id="Ascend-Odering-and-Orientation">Ascend Odering and Orientation<a class="anchor-link" href="#Ascend-Odering-and-Orientation">&#182;</a></h3><p>The asecond odering and orientation is more algebraic, determined by the indices of vertices.</p>
<h4 id="Ascend-ordering">Ascend ordering<a class="anchor-link" href="#Ascend-ordering">&#182;</a></h4><p>The array <code>elem</code> is sorted such that</p>

<pre><code>elem(i,1) &lt; elem(i,2) &lt; elem(i,3) &lt; elem(i,4)

</code></pre>
<p>The local face and local edges is also in the ascend ordering</p>
<ul>
<li><code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3];</code></li>
<li><code>locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];</code></li>
<li><code>edgeofFace = [1 2; 1 3; 2 3];</code></li>
</ul>
<p>Then due to the asecond ordering of <code>elem</code>, globally the <code>edge</code> and <code>face</code> also follow the ascend ordering, i.e.</p>
<ul>
<li><code>edge(e,1) &lt; edge(e,2);</code> </li>
<li><code>face(f,1) &lt; face(f,2) &lt; face(f,3).</code> </li>
</ul>
<p>One can easily see the benefit: the ordering of local edges and local faces is consistent with the global ones and so is their corresponding orientation.</p>
<h4 id="Orientation">Orientation<a class="anchor-link" href="#Orientation">&#182;</a></h4><p>We chose the global ordering orientation for each elment. We chose the orientation corresponding to the ascend ordering for edges
and faces. That is</p>
<ul>
<li><code>elem: sign(v12,v13,v14)</code></li>
<li><code>face:</code>  the normal vector is given by <code>cross(v12,v13)</code></li>
<li><code>edge:</code>  from the node with the smaller global index to the bigger one</li>
</ul>
<p>For faces and edges, the orientation of the ascend ordering and the induced orientation is not consistent. The inconsistency is recorded by</p>
<ul>
<li><code>elem2faceSign = [1 -1 1 -1];</code></li>
<li><code>face2edgeSign = [1 -1 1];</code></li>
</ul>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Positive-Ordering-and-Orientation">Positive Ordering and Orientation<a class="anchor-link" href="#Positive-Ordering-and-Orientation">&#182;</a></h3><p>The positive orientation and ordering is more geometrically consistent in the sense that the orientation of an element is locally consistent with the orientation of the local boundary faces. But it introduces inconsistency with the global orientation of a simplex.</p>
<h4 id="Positive-and-consistent-ordering">Positive and consistent ordering<a class="anchor-link" href="#Positive-and-consistent-ordering">&#182;</a></h4><p>The vertices of <code>elem</code> is sorted such that the signed volume is always positive, i.e. the four vertices follows the right hand rule.</p>
<p>The four faces of a tetrahedron are ordered consistently as</p>

<pre><code>locFace = [2 3 4; 1 3 4; 1 2 4; 1 2 3];

</code></pre>
<p>The six edges of a tetrahedron still ascend ordered</p>

<pre><code>locEdge = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];

</code></pre>
<p>Three edges of a face is ordered consistently</p>

<pre><code>edgeofFace = [2 3; 3 1; 1 2];

</code></pre>
<h4 id="Orientation">Orientation<a class="anchor-link" href="#Orientation">&#182;</a></h4><p>The ascend ordering orientation is used for the global orientation of <code>edge</code> and <code>face</code> arrays. The inconsistency of the local and the global orientation is recorded in
<code>elem2faceSign</code> and <code>elem2edgeSign</code>.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="An-Example">An Example<a class="anchor-link" href="#An-Example">&#182;</a></h3><p>We show two tetrahedron with the ascend ordering.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[34]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="c">% A mesh with two tetrahedron with the ascend ordering</span>
<span class="n">elem</span> <span class="p">=</span> <span class="p">[</span><span class="mi">1</span> <span class="mi">4</span> <span class="mi">5</span> <span class="mi">8</span><span class="p">;</span> <span class="mi">1</span> <span class="mi">4</span> <span class="mi">5</span> <span class="mi">7</span><span class="p">];</span>
<span class="n">node</span> <span class="p">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">;</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">;</span> <span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">;</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">;</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">;</span> <span class="mi">0</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
<span class="n">NT</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">elem</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
<span class="n">showmesh3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">,[],</span><span class="s">&#39;FaceAlpha&#39;</span><span class="p">,</span><span class="mf">0.25</span><span class="p">);</span>
<span class="n">findelem3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">);</span>
<span class="n">findnode3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">(:));</span>
<span class="n">display</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span>
<span class="c">% generate edge array</span>
<span class="n">totalEdge</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">([</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span><span class="p">]);</span> <span class="c">...</span>
                    <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">3</span> <span class="mi">4</span><span class="p">])]);</span>
<span class="n">sortedTotalEdge</span> <span class="p">=</span> <span class="n">sort</span><span class="p">(</span><span class="n">totalEdge</span><span class="p">,</span><span class="mi">2</span><span class="p">);</span>
<span class="p">[</span><span class="n">edge</span><span class="p">,</span> <span class="o">~</span><span class="p">,</span> <span class="n">je</span><span class="p">]</span> <span class="p">=</span> <span class="n">unique</span><span class="p">(</span><span class="n">sortedTotalEdge</span><span class="p">,</span><span class="s">&#39;rows&#39;</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">edge</span><span class="p">);</span>
<span class="c">% generate face array</span>
<span class="n">totalFace</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">([</span><span class="n">elem</span><span class="p">(:,[</span><span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">4</span> <span class="mi">3</span><span class="p">]);</span> <span class="c">...</span>
                    <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">2</span> <span class="mi">4</span><span class="p">]);</span> <span class="n">elem</span><span class="p">(:,[</span><span class="mi">1</span> <span class="mi">3</span> <span class="mi">2</span><span class="p">])]);</span>
<span class="n">sortedTotalFace</span> <span class="p">=</span> <span class="n">sort</span><span class="p">(</span><span class="n">totalFace</span><span class="p">,</span><span class="mi">2</span><span class="p">);</span>                
<span class="p">[</span><span class="n">face</span><span class="p">,</span> <span class="n">i2</span><span class="p">,</span> <span class="n">jf</span><span class="p">]</span> <span class="p">=</span> <span class="n">unique</span><span class="p">(</span><span class="n">sortedTotalFace</span><span class="p">,</span><span class="s">&#39;rows&#39;</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">face</span><span class="p">);</span>
<span class="c">% generate pointers of indices</span>
<span class="n">elem2edge</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">(</span><span class="nb">reshape</span><span class="p">(</span><span class="n">je</span><span class="p">,</span><span class="n">NT</span><span class="p">,</span><span class="mi">6</span><span class="p">))</span>
<span class="n">elem2face</span> <span class="p">=</span> <span class="n">uint32</span><span class="p">(</span><span class="nb">reshape</span><span class="p">(</span><span class="n">jf</span><span class="p">,</span><span class="n">NT</span><span class="p">,</span><span class="mi">4</span><span class="p">))</span>
<span class="c">% find orientation of elem</span>
<span class="p">[</span><span class="n">v</span><span class="p">,</span><span class="n">elemSign</span><span class="p">]</span> <span class="p">=</span> <span class="n">simplexvolume</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">)</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem =

     1     4     5     8
     1     4     5     7


edge =

  9�2 uint32 matrix

   1   4
   1   5
   1   7
   1   8
   4   5
   4   7
   4   8
   5   7
   5   8


face =

  7�3 uint32 matrix

   1   4   5
   1   4   7
   1   4   8
   1   5   7
   1   5   8
   4   5   7
   4   5   8


elem2edge =

  2�6 uint32 matrix

   1   2   4   5   7   9
   1   2   3   5   6   8


elem2face =

  2�4 uint32 matrix

   7   5   3   1
   6   4   2   1


v =

    0.6667
    0.6667


elemSign =

    -1
     1

</pre>
</div>
</div>

<div class="output_area">

<div class="prompt"></div>




<div class="output_png output_subarea ">
<img src="
B3RJTUUH4wEFCiILa00AcAAAACR0RVh0U29mdHdhcmUATUFUTEFCLCBUaGUgTWF0aFdvcmtzLCBJ
bmMuPFjdGAAAACJ0RVh0Q3JlYXRpb24gVGltZQAwNS1KYW4tMjAxOSAwMjozNDoxMYk69nwAABe2
SURBVHic7d1vjF1lnQfw506HLhUnMpJOdWsRS7e4BsKfJgqyAYeFaOoWibLiv2AnxKDBVYbF0LRk
VxSx3bo7YOLuClYrY1oETDBdaxe6dt/AUuBFQQELTSPyTzs2g5Q/pUw7++KU6eXOnTv33rn3nuec
8/m8ur233HnelO98f89zzimNj48HAEhbV9oLAIAQBBIAkRBIAERBIAEQBYEEQBQEEgBREEgAREEg
ARAF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AFgQRAFAQSAFEQSABEQSAB
EAWBBEAUBBIAURBIAERBIAEQBYEEQBQEEgBREEgAREEgARAFgQRAFAQSAFEQSABEQSABEAWBBEAU
BBIAURBIAERBIAEQBYEEQBQEEgBREEgAREEgARAFgQRAFAQSAFEQSABEQSABEAWBBEAUBBIAURBI
AERBIAEQBYEEQBQEEgBREEgAREEgARAFgQRAFAQSAFEQSABEQSABEAWBBEAUBBIAURBIAERBIAEQ
BYEEQBQEEgBREEgAREEgARAFgQRAFAQSAFH4fwLPP2uQ2CHGAAAAAElFTkSuQmCC
"
>
</div>

</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Since we are using the ascend ordering, the inconsistency with the induced orientation is</p>
<ul>
<li><code>elem2faceSign = [1 -1 1 -1];</code></li>
<li><code>face2edgeSign = [1 -1 1];</code></li>
</ul>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Boundary-Faces-and-Boundary-Conditions">Boundary Faces and Boundary Conditions<a class="anchor-link" href="#Boundary-Faces-and-Boundary-Conditions">&#182;</a></h2><p>We use <code>bdFlag</code> to record the boundary condition; see <a href="bddoc.html">Data Structure: Boundary Conditions</a> for details. For short, <code>bdFlag</code> has the same size with <code>elem</code>, and records the boundary type of each local faces. If we change the ordering of <code>elem</code>, the corresponding local faces are changed. Threfore when we sort the <code>elem</code>, we should sort the <code>bdFlag</code> respectively. We use <code>sortelem3</code> to sort <code>elem</code> and <code>bdFlag</code> at the same time. Note that <code>sort(elem,2)</code> sorts the <code>elem</code> only, and leave
<code>bdFlag</code> unchanged.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[35]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="p">[</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">]</span> <span class="p">=</span> <span class="n">cubemesh</span><span class="p">([</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span><span class="mi">2</span><span class="p">);</span>
<span class="n">bdFlag</span> <span class="p">=</span> <span class="n">setboundary3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">,</span><span class="s">&#39;Dirichlet&#39;</span><span class="p">,</span><span class="s">&#39;x==1&#39;</span><span class="p">,</span><span class="s">&#39;Neumann&#39;</span><span class="p">,</span><span class="s">&#39;x~=1&#39;</span><span class="p">);</span>
<span class="n">figure</span><span class="p">(</span><span class="mi">2</span><span class="p">);</span> <span class="n">clf</span><span class="p">;</span>
<span class="n">showmesh3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span> <span class="n">display</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">);</span>
<span class="n">findnode3</span><span class="p">(</span><span class="n">node</span><span class="p">,[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">]);</span>
<span class="n">display</span><span class="p">(</span><span class="s">&#39;change to ascend ordering&#39;</span><span class="p">);</span>
<span class="p">[</span><span class="n">elem</span><span class="p">,</span><span class="n">bdFlag</span><span class="p">]</span> <span class="p">=</span> <span class="n">sortelem3</span><span class="p">(</span><span class="n">elem</span><span class="p">,</span><span class="n">bdFlag</span><span class="p">)</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
elem =

     1     2     3     7
     1     4     3     7
     1     5     6     7
     1     5     8     7
     1     2     6     7
     1     4     8     7


bdFlag =

  6�4 uint8 matrix

   1   0   0   2
   2   0   0   2
   2   0   0   2
   2   0   0   2
   1   0   0   2
   2   0   0   2

change to ascend ordering

elem =

     1     2     3     7
     1     3     4     7
     1     5     6     7
     1     5     7     8
     1     2     6     7
     1     4     7     8


bdFlag =

  6�4 uint8 matrix

   1   0   0   2
   2   0   0   2
   2   0   0   2
   2   0   2   0
   1   0   0   2
   2   0   2   0

</pre>
</div>
</div>

<div class="output_area">

<div class="prompt"></div>




<div class="output_png output_subarea ">
<img src="
B3RJTUUH4wEFCiU2fGTapgAAACR0RVh0U29mdHdhcmUATUFUTEFCLCBUaGUgTWF0aFdvcmtzLCBJ
bmMuPFjdGAAAACJ0RVh0Q3JlYXRpb24gVGltZQAwNS1KYW4tMjAxOSAwMjozNzo1NI+JaBkAACAA
SURBVHic7d1/jJXVve/xNfwYAcHKL5kWWypSy9D6AyeRTCW59xCqBiEaSY6XHz2t5zQ0kaREwzXn
HrpjuVMNsX/gGKZJNf4jtKO19Ec6NC1M9bbVcKCdSOEc7Kn7AgrUkVHBO8hQhmHfP5768Lj3nr2f
/fxY67vWer/iH8OeYc9SZ/Znf9Zaz7OaSqWSAgDAtDGmBwAAgFIEEgBACAIJACACgQQAEIFAAgCI
QCABAEQgkAAAIhBIAAARCCQAgAgEEgBABAIJACACgQQAEIFAAgCIQCABAEQgkAAAIhBIAAARCCRA
ugsXLrz99tumRwHkbpzpAQCoo7e394EHHliyZMmkSZMmTpwY/dTDDz88d+5cUwMDskUgAdK99957
p06dev7558sev/HGG5988kkjQwLyQCAB0u3bt2/Hjh3XXnvtmDGX59g3bty4ffv2ceP4FYY7+GkG
pBsaGlqzZk30kWefffaBBx644YYbTA0JyAOBBEi3adOm6B+LxWJ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QAgAoEEABCBQAIAiEAg
AQBEIJAAACIQSAAAEQgkAIAIBBIAQAQCCQAgAoEEABCBQAIAiEAgAQBEIJAAACIQSAAAEQgkAIAI
BBIAQAQCCQAgAoEEABCBQAIAiEAgAQBEIJAAACIQSAAAEQgkAIAIBBIAQIT/DwHyO/eww8neAAAA
AElFTkSuQmCC
"
>
</div>

</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>We can use <code>bdFlag</code> to find the boundary nodes, edges and faces. To find the outwords normal direction of the boundary face, we use <code>gradbasis3</code> to get <code>Dlambda(t,:,k)</code> which is the gradient of $\lambda_k$. The outward normal direction of the kth face can be obtained by <code>-Dlambda(t,:,k)</code> which is independent of the ordering and orientation of <code>elem</code>.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[36]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">Dlambda</span> <span class="p">=</span> <span class="n">gradbasis3</span><span class="p">(</span><span class="n">node</span><span class="p">,</span><span class="n">elem</span><span class="p">);</span>
<span class="n">T</span> <span class="p">=</span> <span class="n">auxstructure3</span><span class="p">(</span><span class="n">elem</span><span class="p">);</span>
<span class="n">elem2face</span> <span class="p">=</span> <span class="n">T</span><span class="p">.</span><span class="n">elem2face</span><span class="p">;</span> 
<span class="n">face</span> <span class="p">=</span> <span class="n">T</span><span class="p">.</span><span class="n">face</span><span class="p">;</span>
<span class="n">NF</span> <span class="p">=</span> <span class="nb">size</span><span class="p">(</span><span class="n">face</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
<span class="k">if</span> <span class="o">~</span><span class="nb">isempty</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">)</span>
    <span class="c">% Find Dirchelt boundary faces and nodes</span>
    <span class="n">isBdFace</span> <span class="p">=</span> <span class="n">false</span><span class="p">(</span><span class="n">NF</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
    <span class="n">isBdFace</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">))</span> <span class="p">=</span> <span class="n">true</span><span class="p">;</span>
    <span class="n">isBdFace</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">2</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">))</span> <span class="p">=</span> <span class="n">true</span><span class="p">;</span>
    <span class="n">isBdFace</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">3</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span><span class="mi">3</span><span class="p">))</span> <span class="p">=</span> <span class="n">true</span><span class="p">;</span> 
    <span class="n">isBdFace</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">4</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span><span class="mi">4</span><span class="p">))</span> <span class="p">=</span> <span class="n">true</span><span class="p">;</span>
    <span class="n">DirichletFace</span> <span class="p">=</span> <span class="n">face</span><span class="p">(</span><span class="n">isBdFace</span><span class="p">,:);</span>
    <span class="c">% Find outwards normal direction of Neumann boundary faces</span>
    <span class="n">bdFaceOutDirec</span> <span class="p">=</span> <span class="nb">zeros</span><span class="p">(</span><span class="n">NF</span><span class="p">,</span><span class="mi">3</span><span class="p">);</span>
    <span class="n">bdFaceOutDirec</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span><span class="mi">1</span><span class="p">),:)</span> <span class="p">=</span> <span class="o">-</span><span class="n">Dlambda</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,:,</span><span class="mi">1</span><span class="p">);</span>
    <span class="n">bdFaceOutDirec</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">2</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">),:)</span> <span class="p">=</span> <span class="o">-</span><span class="n">Dlambda</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">2</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,:,</span><span class="mi">2</span><span class="p">);</span>
    <span class="n">bdFaceOutDirec</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">3</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">),:)</span> <span class="p">=</span> <span class="o">-</span><span class="n">Dlambda</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">3</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,:,</span><span class="mi">3</span><span class="p">);</span>
    <span class="n">bdFaceOutDirec</span><span class="p">(</span><span class="n">elem2face</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">4</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">),:)</span> <span class="p">=</span> <span class="o">-</span><span class="n">Dlambda</span><span class="p">(</span><span class="n">bdFlag</span><span class="p">(:,</span><span class="mi">4</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,:,</span><span class="mi">4</span><span class="p">);</span>
<span class="k">end</span>
<span class="c">% normalize the boundary face outwards direction</span>
<span class="n">vl</span> <span class="p">=</span> <span class="nb">sqrt</span><span class="p">(</span><span class="nb">dot</span><span class="p">(</span><span class="n">bdFaceOutDirec</span><span class="p">,</span><span class="n">bdFaceOutDirec</span><span class="p">,</span><span class="mi">2</span><span class="p">));</span>
<span class="n">idx</span> <span class="p">=</span> <span class="p">(</span><span class="n">vl</span><span class="o">==</span><span class="mi">0</span><span class="p">);</span>
<span class="n">NeumannFace</span> <span class="p">=</span> <span class="n">face</span><span class="p">(</span><span class="o">~</span><span class="n">idx</span><span class="p">,:);</span>
<span class="n">bdFaceOutDirec</span><span class="p">(</span><span class="n">idx</span><span class="p">,:)</span> <span class="p">=</span> <span class="p">[];</span>
<span class="n">vl</span><span class="p">(</span><span class="n">idx</span><span class="p">)</span> <span class="p">=</span> <span class="p">[];</span>
<span class="n">bdFaceOutDirec</span> <span class="p">=</span> <span class="n">bdFaceOutDirec</span><span class="o">./</span><span class="p">[</span><span class="n">vl</span> <span class="n">vl</span> <span class="n">vl</span><span class="p">];</span>
<span class="n">display</span><span class="p">(</span><span class="n">DirichletFace</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">NeumannFace</span><span class="p">);</span>
<span class="n">display</span><span class="p">(</span><span class="n">bdFaceOutDirec</span><span class="p">);</span>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt"></div>


<div class="output_subarea output_stream output_stdout output_text">
<pre>
DirichletFace =

  2�3 uint32 matrix

   2   3   7
   2   6   7


NeumannFace =

  10�3 uint32 matrix

   1   2   3
   1   2   6
   1   3   4
   1   4   8
   1   5   6
   1   5   8
   3   4   7
   4   7   8
   5   6   7
   5   7   8


bdFaceOutDirec =

     0     0    -1
     0    -1     0
     0     0    -1
    -1     0     0
     0    -1     0
    -1     0     0
     0     1     0
     0     1     0
     0     0     1
     0     0     1

</pre>
</div>
</div>

</div>
</div>

</div>
    </div>
  </div>
</body>

 


</html>
